package com.cardone.platform.authority.service;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;


import lombok.Getter;


import lombok.Setter;

import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.joda.time.DateTime;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.transaction.annotation.Transactional;

import com.cardone.common.dto.PaginationDto;
import com.cardone.common.cache.Caches;
import com.cardone.context.Attributes;
import com.cardone.context.ContextHolder;
import com.cardone.common.util.EntityUtils;
import com.cardone.platform.authority.dao.PeVaRuTransactModeDao;
import com.cardone.platform.authority.dto.PeVaRuTransactModeDto;

/**
 * 许可、验证规则与处理模式服务
 *
 * @author yaohaitao
 * 
 */
@Getter 
@Setter
@Transactional(readOnly = true)
public class PeVaRuTransactModeDefaultService implements PeVaRuTransactModeService {
	@Override
	@Transactional
	public <P> P saveByIdOrCode(Class<P> mappedClass, PeVaRuTransactModeDto savePeVaRuTransactMode) {
		return ContextHolder.getBean(PeVaRuTransactModeDao.class).saveByIdOrCode(mappedClass, savePeVaRuTransactMode);
	}
	
	@Override
	@Transactional
	public PeVaRuTransactModeDto saveByIdOrCode(PeVaRuTransactModeDto savePeVaRuTransactMode) {
		return ContextHolder.getBean(PeVaRuTransactModeDao.class).saveByIdOrCode(PeVaRuTransactModeDto.class, savePeVaRuTransactMode);
	}
	
	@Override
	public <P> P findByCodeOrId(Class<P> mappedClass, PeVaRuTransactModeDto findPeVaRuTransactMode) {
		return ContextHolder.getBean(PeVaRuTransactModeDao.class).findByCodeOrId(mappedClass, findPeVaRuTransactMode);
	}
	
	@Override
	public Integer readByCodeNqIdForCount(PeVaRuTransactModeDto readPeVaRuTransactMode) {
		return ContextHolder.getBean(PeVaRuTransactModeDao.class).readByCodeNqIdForCount(readPeVaRuTransactMode);
	}
	
	@Override
	@Transactional
	public int insertByCode(PeVaRuTransactModeDto insertPeVaRuTransactMode) {
		return ContextHolder.getBean(PeVaRuTransactModeDao.class).insertByCode(insertPeVaRuTransactMode);
	}
	
	@Override
	@Transactional
	public int updateByCode(PeVaRuTransactModeDto updatePeVaRuTransactMode) {
		return ContextHolder.getBean(PeVaRuTransactModeDao.class).updateByCode(updatePeVaRuTransactMode);
	}

	@Override
	@Transactional
	public int deleteByIds(PeVaRuTransactModeDto deletePeVaRuTransactMode) {
		return ContextHolder.getBean(PeVaRuTransactModeDao.class).deleteByIds(deletePeVaRuTransactMode);
	}

	@Override
	public <P> P findById(Class<P> mappedClass, PeVaRuTransactModeDto findPeVaRuTransactMode) {
		return ContextHolder.getBean(PeVaRuTransactModeDao.class).findById(mappedClass, findPeVaRuTransactMode);
	}

	@Override
	public <P> List<P> findListByLikeCode(Class<P> mappedClass, PeVaRuTransactModeDto findListPeVaRuTransactMode) {
		return ContextHolder.getBean(PeVaRuTransactModeDao.class).findListByLikeCode(mappedClass, findListPeVaRuTransactMode);
	}

	@Override
	public <P> List<P> findList(Class<P> mappedClass) {
		return ContextHolder.getBean(PeVaRuTransactModeDao.class).findList(mappedClass);
	}

	@Override
	public <P> PaginationDto<P> paginationByLikeCode(Class<P> mappedClass, PeVaRuTransactModeDto paginationPeVaRuTransactMode) {
		return ContextHolder.getBean(PeVaRuTransactModeDao.class).paginationByLikeCode(mappedClass, paginationPeVaRuTransactMode);
	}
}